package com.jr.service;

import com.jr.entity.Email;

import java.util.List;

public interface EmailService {
    /**
     * 新增邮箱
     * @param email 对象
     * @return
     * @throws Exception
     */
    int addEmails(Email email)throws Exception;

    /**
     * 根据企业id查询所有邮箱
     * @param enterpriseId
     * @return
     * @throws Exception
     */
    List<Email> selectAllEmail(Integer enterpriseId)throws Exception;

    /**
     * 根据id更新exist状态
     * @param emailId
     * @return
     * @throws Exception
     */
    int updateEmailExist(Integer emailId)throws Exception;

    /**
     * 根据企业id查询email是否存在
     * @param emailId
     * @return
     * @throws Exception
     */
    boolean checkEmailIsExist(String emailName)throws Exception;

    /**
     * 根据id设置邮箱默认
     * @return
     * @throws Exception
     */
    int setEmailDefaultById(Integer emailId)throws Exception;

    /**
     * 将所有默认改为普通
     * @return
     * @throws Exception
     */
    int setAllEmailDefault()throws Exception;
}
